package com.zzvcom.office.services;

import com.zzvcom.office.entities.OfficePdf;
import com.zzvcom.office.repositories.OfficePdfRepository;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Optional;

/**
 * pdf转码 服务
 */
@Slf4j
@Service
public class OfficePdfServices {
    @Autowired
    private OfficePdfRepository officePdfRepository;

    public OfficePdf getById(String id) {
        Optional<OfficePdf> byId = officePdfRepository.findById(id);
        return byId.isPresent() ? byId.get() : null;
    }

    public void save(OfficePdf officePdf) {
        officePdfRepository.save(officePdf);
    }
}
